//initState
const initState = {
    msg:'hello'
}

//action

export const changeMsg =(msg)=>{
    return {
        type:'CHANGE_MSG',
        msg
    }
}

//reducer
export default ((state=initState,action)=>{
    switch (action.type) {
        case 'CHANGE_MSG':
            return {...state,msg:action.msg}
        default:
            return state
    }
})